<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css">
    <link rel="stylesheet" type="text/css" href="../css/aui-slide.css">
    <link rel="stylesheet" type="text/css" href="../css/api.css">
    <script type="text/javascript" src="../script/api.js"></script>
</head>

<body>
    <header class="aui-bar aui-bar-nav" id="header">
        <span class="aui-iconfont aui-icon-left aui-pull-left" onclick="api.closeWin()">返回</span>
    </header>
    <div class="main" id="main" style="height:100%;">

    </div>
</body>
<script type="text/javascript">
    apiready = function() {
        var header = $api.byId('header');
        var headerPos = $api.offset(header);
        var url = api.pageParam.url;
        
        var body = {
            id: api.pageParam.id,
            token: api.pageParam.token
        }

        function openGoods(url) {
            api.openFrame({
                name: 'goods',
                url: url,
                rect: {
                    x: 0,
                    y: headerPos.h,
                    w: 'auto',
                    h: 'auto'
                },
                allowEdit:true
            });
            api.ajax({
                url: 'http://www.mk517.com/webApi/buylog.php',
                method: 'post',
                dataType: 'json',
                "headers": {
                    "Content-Type": "application/json"
                },
                data: {
                    body: body
                }
            }, function(ret, err) {

            });
        }
        openGoods(url);
    }
</script>

</html>
